<template>
	<view class="f-f-c">
		<u-navbar
		:autoBack="true" bgColor="#fff"
		leftIconColor='#000'
		:titleStyle="{ color: '#000'}"
		 title="消息详情" rightText='' :border="false" :placeholder="true">
			 
		</u-navbar>
	 
		<view class="bf p20">
			<view class="f-c  cp fb mt40 f36">
				{{info.noticeTitle}}
			</view>
			<view class="f-c c9  mt20 f28">
				更新时间：{{info.updateTime}}
			</view>
			<view  v-html="info.noticeContent">
				
			</view>
			
		</view>
		
	</view>
</template>


<script>
	  export default {
		data() {
			return {
				list1:[ ],
				high:0,
				info:{},
			}
		},
		onReachBottom() {
			
		},
		onReady() {
			
		},
		onLoad(option){
			this.getHeight()
			if(option.data){
				// this.getDetail(option.id)
				this.info = JSON.parse(option.data)
				console.log(this.info)
			}
			
		},
		onShow() {
			
		},
		methods: {
			// 设置scoll高度
			getHeight(){
				let that = this
				uni.getSystemInfo({
					success: function (res) {
						let windowHeight= res.windowHeight;
						let h = that.rpxToPx(440) 
						let hp= windowHeight  - h
						that.high = that.pxToRpx(hp)
						console.log(that.high ,'windowHeight')
					}
				});
			},
			// rpx转px
			rpxToPx(rpx) {
				console.log(rpx,'rpx')
				const screenWidth = uni.getSystemInfoSync().screenWidth
				return (screenWidth * Number.parseInt(rpx)) / 750
			},
			 
			// px转rpx
			pxToRpx(px) {
				const screenWidth = uni.getSystemInfoSync().screenWidth
				return (750 * Number.parseInt(px)) / screenWidth
			},
			getDetail(id){
				let that = this
				this.$api.request('get', `news/app/${id}`).then(res => {
				 // console.log(res.data,'res')
				 that.info = res.data
				 that.list1 = [res.data.imgUrl]
				}).catch(err => {
				  that.$api.msg('请求失败，请稍后再试')
				})
			}
		}
	}
</script>

<style lang='scss'>
	page,
	.content {
		min-height: 50%;
		background-color: #fff;
	}

	.bg1,.bg2,.bg3,.bg4{
		width: 338rpx;
		height: 164rpx;
		background: none;
		background-image: url('https://chaoyuanhuishou.oss-cn-beijing.aliyuncs.com/c1.png');
		background-size: 100% 100%;
		/* box-shadow: 0rpx 0rpx 8rpx 2rpx rgba(0,0,0,0.1); */
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		opacity: 1;
	}
	.bg2{
		background-image: url('https://chaoyuanhuishou.oss-cn-beijing.aliyuncs.com/c2.png');
	}
	.bg3{
		background-image: url('https://chaoyuanhuishou.oss-cn-beijing.aliyuncs.com/c3.png');
	}
	.bg4{
		background-image: url('https://chaoyuanhuishou.oss-cn-beijing.aliyuncs.com/c4.png');
	}
	.btn{
		position: absolute;
		bottom: 40rpx;
		left: 50%;
		transform: translate(-50%,0);
		width: 700rpx;
		height: 88rpx;
		background: linear-gradient(90deg, #31EB8D 0%, #4CC097 100%);
		box-shadow: 0rpx 2rpx 4rpx 2rpx rgba(0,0,0,0.16);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		opacity: 1;
		font-weight: bold;
		color: #FFFFFF;
		text-align: center;
		line-height: 88rpx;
	
	}
	
</style>
